package cn.com.dcsgo.sdk.payment.wechat.ltzf.factory;

import lombok.Getter;
import lombok.Setter;
import okhttp3.OkHttpClient;
import okhttp3.logging.HttpLoggingInterceptor;

/**
 * 配置类(蓝兔支付、HTTP相关配置)
 *
 * @author Dcsgo
 * @since 2024/8/13 上午9:55
 */
@Getter
public class Configuration {
    /**
     * 蓝兔支付请求URL(公共部分)
     */
    @Setter
    private String apiHost = "https://api.ltzf.cn/";

    /**
     * 开发者应用ID
     */
    private final String appId;
    /**
     * 商户号
     */
    private final String merchantId;
    /**
     * 商户密钥
     */
    private final String partnerKey;

    /**
     * 构造配置类
     *
     * @param appId      开发者应用ID
     * @param merchantId 商户号
     * @param partnerKey 商户密钥
     */
    public Configuration(String appId, String merchantId, String partnerKey) {
        this.appId = appId;
        this.merchantId = merchantId;
        this.partnerKey = partnerKey;
    }

    /**
     * HTTP客户端，用于发送 HTTP 请求和接收 HTTP 响应
     */
    @Setter
    private OkHttpClient okHttpClient;
    /**
     * HTTP日志级别
     */
    @Setter
    private HttpLoggingInterceptor.Level level = HttpLoggingInterceptor.Level.HEADERS;
    /**
     * HTTP连接超时时间
     */
    @Setter
    private long connectTimeout = 10L;
    /**
     * HTTP写超时时间
     */
    @Setter
    private long writeTimeout = 10L;
    /**
     * HTTP读超时时间
     */
    @Setter
    private long readTimeout = 10L;
}
